<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>

<div class="row">
    <div class="col-md-12">
            <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title"><?php echo anchor('backend/ionauth/users/create', '<i class="fa fa-plus"></i> '. lang('users_create_user'), array('class' => 'btn btn-block btn-primary btn-flat')); ?></h3>
            </div>
            <div class="box-body">
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <!--  <th><?php echo lang('users_firstname');?></th>-->
                            <th><?php echo lang('users_lastname');?></th>
                            <th><?php echo lang('users_email');?></th>
                            <th><?php echo lang('users_groups');?></th>
                            <th><?php echo lang('users_status');?></th>
                            <th><?php echo lang('users_action');?></th>
                        </tr>
                    </thead>
                    <tbody>
<?php foreach ($users as $user):?>
                        <tr>
                            <!--  <td><?php echo htmlspecialchars($user->first_name, ENT_QUOTES, 'UTF-8'); ?></td> -->
                            <td><?php echo htmlspecialchars($user->last_name, ENT_QUOTES, 'UTF-8'); ?></td>
                            <td><?php echo htmlspecialchars($user->email, ENT_QUOTES, 'UTF-8'); ?></td>
                            <td>
<?php foreach ($user->groups as $group):?>
                                <?php echo anchor('backend/ionauth/groups/edit/'.$group->id, '<span class="label" style="background:'.$group->bgcolor.';">'.htmlspecialchars($group->name, ENT_QUOTES, 'UTF-8').'</span>'); ?>
<?php endforeach?>
                            </td>
                            <td><?php echo ($user->active) ? anchor('backend/ionauth/users/deactivate/'.$user->id, '<span class="label label-success">'.lang('users_active').'</span>') : anchor('backend/ionauth/users/activate/'. $user->id, '<span class="label label-default">'.lang('users_inactive').'</span>'); ?></td>
                            <td>
                                <?php echo anchor('backend/ionauth/users/edit/'.$user->id, lang('actions_edit')); ?>  &nbsp&nbsp
                                <?php echo anchor('backend/ionauth/users/profile/'.$user->id, lang('actions_see')); ?>&nbsp&nbsp
                                <?php echo anchor('backend/ionauth/users/edit_permission/'.$user->id, '权限'); ?>
                            </td>
                        </tr>
<?php endforeach;?>
                    </tbody>
                </table>
            </div>
        </div>
        </div>
</div>
              